package com.xyd.Biz.Impl;

import com.xyd.Biz.OrderFormBiz;
import com.xyd.Dao.OrderFormDao;
import com.xyd.Entity.OrderForm;
import com.xyd.Util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @ClassName: OrderFormBizImpl
 * @Description:
 * @Author 余全盛
 * @Date: 2021/10/15 17:04
 */
public class OrderFormBizImpl implements OrderFormBiz {
OrderFormDao orderFormDao=null;
public OrderFormBizImpl(){
    SqlSession session= SqlSessionFactoryUtil.open();
    orderFormDao=session.getMapper(OrderFormDao.class);
}
    @Override
    public int addSonOrder(int com_id, int num, Double price, double sonordersum, long fatherorderid) {
        return orderFormDao.addSonOrder(com_id, num, price, sonordersum, fatherorderid);
    }

    @Override
    public List<OrderForm> selectSonOrder(long fatherOrderid) {
        return orderFormDao.selectSonOrder(fatherOrderid);
    }

    @Override
    public List<OrderForm> selectAllSonOrder() {
        return orderFormDao.selectAllSonOrder();
    }

    @Override
    public int updateSonOrderState(int state,int sonorderid) {
        return orderFormDao.updateSonOrderState(state, sonorderid);
    }

    @Override
    public int updateSonOrderStateByFatherOrderID(int state, long fatherorderid) {
        return orderFormDao.updateSonOrderStateByFatherOrderID(state, fatherorderid);
    }

}
